/*
package com.aaa.come.service.impl;

import com.aaa.come.controller.OutorderController;
import com.aaa.come.entity.Outorder;
import com.aaa.come.entity.Picktask;
import com.aaa.come.mapper.PicktaskMapper;
import com.aaa.come.service.PicktaskService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

*/
/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author aaa
 * @since 2020-11-24
 *//*

@Service
public class PicktaskServiceImpl extends ServiceImpl<PicktaskMapper, Picktask> implements PicktaskService {

    @Autowired
    private PicktaskMapper picktaskMapper;

    @Autowired
    private OutorderController outorderController;

    */
/**
    * @Description: 按条件分页查询 //描述
    * @Param: [page（页数）, size（一页几条数据）, picktask（条件封装类）]//参数
    * @return: com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.aaa.come.entity.Picktask>
    * @Author: 岚氓//作者
    * @Date: 2020/11/27  10:14
    *//*

    @Override
    public Page<Picktask> findPagePicktaskService(Integer page, Integer size, Picktask picktask) {
        Page<Picktask> pageinfo = new Page<>(page, size);
        QueryWrapper<Picktask> queryWrapper = new QueryWrapper<>();
        if (StringUtils.isNotEmpty(picktask.getPicktaskno())) {
            queryWrapper.like("picktaskno", picktask.getPicktaskno());
        }
        if (StringUtils.isNotEmpty(picktask.getReceiver())) {
            queryWrapper.like("receiver", picktask.getReceiver());
        }
        if (picktask.getOutorderid() != null) {
            String picktaskno = picktaskMapper.findPicktaskno(picktask.getOutorderid());
            queryWrapper.like("picktaskno", picktaskno);
        }
        if (picktask.getReceive() != null && picktask.getReceive() == 1) {
            queryWrapper.isNotNull("receivetime");
        }

        return picktaskMapper.selectPage(pageinfo, queryWrapper);
    }

    @Override
    public Long findOutorderid(String picktaskno) {
        return picktaskMapper.findOutorderid(picktaskno);
    }

    
    */
/**
    * @Description: 拣货任务还原 //描述
    * @Param: [id]//参数
    * @return: boolean
    * @Author: 岚氓//作者
    * @Date: 2020/11/27  14:04
     *
    *//*

    @Override
    public boolean deletePicktask(Integer id) {//传入拣货任务ID
        try {
            Picktask byId = picktaskMapper.selectById(id);//根据拣货任务ID查询出拣货任务单号
            List<Outorder> list=new ArrayList<>();
            String picktaskno=byId.getPicktaskno();//拣货任务单号
            Long outorderid = picktaskMapper.findOutorderid(picktaskno);//根据拣货任务单号查询出出库订单id
            Outorder outorder=new Outorder();
            outorder.setId(outorderid);
            outorder.setState("2");
            list.add(outorder);
            outorderController.updateAuditState(list);//修改出库任务订单状态
            picktaskMapper.deleteById(id);//删除拣货任务
            return true;
        }catch (Exception e){
            e.printStackTrace();
            return false;
        }
    }


}
*/
